-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wave9] Progress Bar UI #64
Conversation
…re-mansion-labs/expensify-app-fork into wave9/header-progress-bar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor code issue, and run typecheck
because there are some issues in files you didn't change, but they are affected by your changes.
shouldShowProgressBar: boolean; | ||
|
||
/** 0 - 100 number indicating current progress of the progress bar */ | ||
progressBarPercentage: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are non-null props, but you're setting the default value here, not sure what was the purpose, but that's something that needs to be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- @mateuuszzzzz we will drop pair-props and stay with just one prop https://docs.google.com/document/d/1sxG_RV5HTFHgdCsJUDNpqSGs09W_OPLBKbNYQfu3FHw/edit#heading=h.qcbt20goffpx sorry for a late change
@@ -70,6 +71,33 @@ function HeaderWithBackButton({ | |||
// If the icon is present, the header bar should be taller and use different font. | |||
const isCentralPaneSettings = !!icon; | |||
|
|||
let middleContent = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let middleContent = null; | |
let middleContent; |
if (progressBarPercentage) { | ||
middleContent = ( | ||
<View> | ||
<View style={styles.progressBarWrapper}> | ||
<View style={[{width: `${progressBarPercentage}%`}, styles.progressBar]} /> | ||
</View> | ||
</View> | ||
); | ||
} else if (shouldShowAvatarWithDisplay) { | ||
middleContent = ( | ||
<AvatarWithDisplayName | ||
report={report} | ||
policy={policy} | ||
shouldEnableDetailPageNavigation={shouldEnableDetailPageNavigation} | ||
/> | ||
); | ||
} else { | ||
middleContent = ( | ||
<Header | ||
title={title} | ||
subtitle={stepCounter ? translate('stepCounter', stepCounter) : subtitle} | ||
textStyles={titleColor ? [StyleUtils.getTextColorStyle(titleColor)] : []} | ||
/> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider wrapping it in useMemo
https://linear.app/expensify-swm/issue/EXP-274/[wave-9]-new-onboarding-flow-progress-bar-[just-the-ui]
UI and Storybook for the Progress bar. To test, easiest way is to
npm run storybook
http://localhost:6006/?path=/story/components-headerwithbackbutton--progress-bar
Storybook seems to be broken after merge. Looks like it's broken on main as well. In this case best way to test is to do
progressBarPercentage = 25,
insrc/components/HeaderWithBackButton/index.tsx
and to open workspace switcher or any screen with header